<?php
/*
 * Created on Apr 2, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

class File_AjaxController extends Clu_Controller_Action_Hvn
{
	public function init()
	{
//		require (APP_PATH."/library/Utils/Utils_Image.php");
		$this->m = new gallery_Model_Gallery();
	}
	
	public function uploadAction()
	{
		$form = new gallery_Form_Gallery();
		$request = $this->getRequest();
		$ret = array();
		if ($form->isValid($request->getPost())) 
		{
            $ret['success'] = true;
            $ret['values'] = $form->getValues();
        } 
        else 
        {
            $ret['success'] = false;
        }
       

//        if ($request->isXmlHttpRequest()) 
//        {
//        	if($this->m->postImage())
//				$ret['success'] = true;
//			else
//			{
//				$ret['success'] = false;
//				$ret['text'] = "Post not valid + " . implode(',',$form->getErrorMessages());
//			}
//            $this->_helper->json->sendJson($ret);
//        } 
	}
	
}
?>
